package demo.demo05;

public class FingerGuess {
    String name;
    int finger;
    
    //构造方法
    public FingerGuess(String name) {
        this.name = name;
    }
    
    //出拳
    public void showFinger() {
        finger = (int) (Math.random() * 3);
    }

    //显示
    public void show() {
        switch (finger) {
            case 0:
                System.out.println(name + "出拳：剪刀");
                break;
            case 1:
                System.out.println(name + "出拳：石头");
                break;
            case 2:
                System.out.println(name + "出拳：布");
                break;
        }
    }
}
